package com.axxc.jpa.event.listener;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.ApplicationListener;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;

import com.alibaba.fastjson.JSONObject;
import com.axxc.jpa.event.TestEvent;

/**
 * 
 * @ClassName: TestEventListener
 * @Description: TODO(这里用一句话描述这个类的作用)
 * @author xxc
 * @date 2018年8月11日 下午3:08:21
 * @see {@link https://gitee.com/biuabiu/spring-data-jpa}
 */
@Component
@Async
public class TestEventListener implements ApplicationListener<TestEvent> {

	protected Logger logger = LoggerFactory.getLogger(getClass());

	@Override
	public void onApplicationEvent(TestEvent event) {
		logger.info("msg:{},entity:{}", event.getMsg(), JSONObject.toJSONString(event.getSource()));
	}

}
